package com.study.user;

import android.annotation.SuppressLint;
import android.view.View;
import android.widget.LinearLayout;

import androidx.appcompat.widget.Toolbar;

import com.common.base.activity.BaseThemeActivity;
import com.common.bean.InfoResult;
import com.common.ui.barlibrary.ImmersionBar;
import com.mikepenz.google_material_typeface_library.GoogleMaterial;
import com.study.R;

import butterknife.BindView;

/**
 * 系统公告
 */
public class AdviceActivity extends BaseThemeActivity {

    @BindView(R.id.background)
    LinearLayout background;
    private Toolbar toolbar;

    @Override
    public boolean isImmersionBarEnabled() {
        return true;
    }

    @SuppressLint({"Range", "ResourceType"})
    @Override
    protected void initImmersionBar() {
        super.initImmersionBar();
        ImmersionBar.with(this)
                .init();
    }

    @Override
    public boolean isSupportSwipeBackEnabled() {
        return false;
    }

    @Override
    public View isSupportLoadSirEnabled() {
        return null;
    }

    @Override
    public int getLayoutResId() {
        return R.layout.activity_advice;
    }

    @Override
    public void init() {
        initToolbar();
    }

    private void initToolbar() {
        toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        toolbar.setNavigationIcon(getToolbarIcon(GoogleMaterial.Icon.gmd_arrow_back));
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });
        getSupportActionBar().setTitle(R.string.advice);
    }

    @Override
    public void loadData() {

    }

    @Override
    public void updateUiElements() {
        super.updateUiElements();
        findViewById(R.id.background).setBackgroundColor(getBackgroundColor());
        setStatusBarNavigationBarColor();
    }

    @Override
    protected void onSuccess(int what, InfoResult t) {

    }

    @Override
    protected void onFail(int what, InfoResult t) {

    }
}
